<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>animated动画</title>
    <link rel="stylesheet" href="./animate.css">
    <script src="./vue.js"></script>

    <style>
        /* @keyframes moving {
            0% {
                transform: scale(0)
            }

            50% {
                transform: scale(2)
            }

            100% {
                transform: scale(1)
            }
        } */
        /* .active {
            transform-origin: left center;
          
            animation: moving 2s
        }

        .leave {
            transform-origin: left center;
            animation: moving 2s reverse;
        } */
    </style>
</head>

<body>
    <div id="app">
        <h2>增加appear 实现一进来就有动画效果</h2>

        <transition name='fade' appear enter-active-class="animated swing" leave-active-class='animated shake' appear-active-class='animated shake'>
            <div v-show="flag">hello world</div>

        </transition>
        <button @click="change">切换动画</button>

    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                flag: true
            },
            methods: {
                change() {
                    this.flag = !this.flag
                }
            }
        })
    </script>
</body>

</html>